<?php
  
    class pos extends model {
  
    function view(){ 
    

    $folder="/pos";
    if($_GET['oauth'])
    {
    
    
      $datauser=$this->getuserbyoauth($_GET['oauth']); 
      
       if($datauser['roleid']=='3'||$datauser['roleid']=='4'||$datauser['roleid']=='5')
                {
                $_COOKIE['poslogin']=1;
                }   
    
    }
    
    if($_COOKIE['poslogin'])
    {
    if(!$this->info['parameter']['0'])
    {
    $this->info['parameter']['0']='sell';
    
    }


    if($this->info['parameter']['0']=='sell')
    {
    $file='pos-psale';
    
    
     if($_GET['orderid'])
    {
    $arrayorder=$this->getorderbyid($_GET['orderid']);
    $arraynewdata['orderlist']=$arrayorder;
   // echo "<pre>";
//    print_r($arrayorder);
//    echo "</pre>;";
//    exit;
    
    }
    
    $arraynewdata['tagordersystem']=$this->gettagproductdata();
    $arraynewdata['product']=$this->getproductpricedata();
    $arraynewdata['poppular']=$this->getpoppularpricedata();
    $arraynewdata['promotion']=$this->getproductdiscountdata();
    $arraynewdata['province']=$this->getprovince();
    
   
    
    
    
    
    

    
    $this->loadtemplate($file,$arraynewdata,$folder);
    exit;
    
    }
    else if($this->info['parameter']['0']=='order')
    {
    $file='pos-porder';
    $this->loadtemplate($file,$arraynewdata,$folder);
        exit;
    
    }else if($this->info['parameter']['0']=='member')
    {
    
    $file='pos-pmember';
    $this->loadtemplate($file,$arraynewdata,$folder);
        exit;
    exit;
    }
    
    else if($this->info['parameter']['0']=='stat')
    {
    
    $file='pos-pstat';
    $this->loadtemplate($file,$arraynewdata,$folder);
        exit;
    exit;
    }
    
    
    }else
    {
    
    $file='pos-plogin';  
    
    
    
    }
    if($file)
    {
    $arraynewdata['folderset']=$folder;
    
    $this->loaddata($file,$arraynewdata,$folder);
    }else
    {
    
    
    
    }

    
    }
   
   
   }
?>
